package week07.day02;

/**
 * 子类继承父类非私有的属性和方法
 * 子类 extends 父类
 * 类之间的继承只能是单继承
 * 一个父类可以有多个子类 一个子类只能有一个父类
 */

public class 继承 {
    public static void main(String[] args) {
        price price = new price();
        price.PhoneName = "Xiaomi 11 Pro";
        price.Price = 1999;
        System.out.println(price.PhoneName);
        System.out.println(price.Price);
    }
}
//父类
class phone{
    String PhoneName;
}

//子类 extends 声明父类
class price extends phone{
    int Price;
}